﻿using System;

namespace Ooaavee.TestTools
{
    /// <summary>
    /// Provides data for the <see cref="TestBase.BeforeTest"/>, <see cref="TestBase.AfterTest"/>, <see cref="TestBase.AfterPassedTest"/> and 
    /// <see cref="TestBase.AfterFailedTest"/> events.
    /// </summary>
    public class TestMethodEventArgs : EventArgs
    {
        private readonly ExtendedTestContext _extendedTestContext;
        
        /// <summary>
        /// Initializes a new instance of the <see cref="TestMethodEventArgs"/> class.
        /// </summary>
        /// <param name="extendedTestContext">Provides information about and functionality for the current test run.</param>
        public TestMethodEventArgs(ExtendedTestContext extendedTestContext)
        {
            if (extendedTestContext == null)
            {
                throw new ArgumentNullException("extendedTestContext");
            }
            _extendedTestContext = extendedTestContext;
        }

        /// <summary>
        /// Provides information about and functionality for the current test run.
        /// </summary>
        public ExtendedTestContext ExtendedTestContext { get { return _extendedTestContext; } }
    }
}
